<template>
  <div class="article-item-container">
    <van-cell
      v-for="(item, index) in articleList"
      :key="index"
      :title="item.title"
      :to="'/article/' + item.art_id"
    >
      <!-- 新闻内容模板 -->
      <template slot="label">
        <div v-if="item.cover.images.length > 1 ? true : false">
          <img
            style="width:100px;height:80px;margin:5px"
            v-for="(item2, index2) in item.cover.images"
            :key="index2"
            :src="item2"
            alt=""
          />
        </div>
        <div>
          <span>{{ item.aut_name }}</span>
          <span> {{ item.comm_count }}评论</span>
          <span> {{ item.pubdate | format }}</span>
        </div>
      </template>
      <template slot="extra">
        <div v-if="item.cover.images.length == 1 ? true : false">
          <img
            style="width:80px;height:100px"
            :src="item.cover.images[0]"
            alt=""
          />
        </div>
      </template>
      <!-- 新闻内容模板 -->
    </van-cell>
  </div>
</template>

<script>
export default {
  props: {
    articleList: {
      type: Array,
      default: () => {
        return [];
      }
    }
  }
};
</script>
<style scoped></style>
